package com.koron.order.overhaul.bean.convertor;

import com.koron.order.common.bean.po.OrderDispatch;
import com.koron.order.common.bean.po.OrderDispatchTeam;
import com.koron.order.common.bean.po.OrderExecute;
import com.koron.order.common.bean.vo.OrderExecuteVo;
import com.koron.order.overhaul.bean.entity.*;
import com.koron.order.overhaul.bean.vo.*;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * @author twcao
 * @title: OverhaulOrderMajorConvertor
 * @projectName GDH_EAM_V2
 * @description: 专业实体转换
 * @date 2021/9/2916:07
 */
@Mapper(componentModel = "spring")
public interface OverhaulOrderConvertor {

    OverhaulOrderMajorBean majorVOToBean(OverhaulOrderMajorVO vo);

    List<OverhaulOrderMajorBean> majorVOsToBeans(List<OverhaulOrderMajorVO> vos);

    OverhaulOrderMajorFormBean formVOToBean(OverhaulOrderMajorFormVO vo);

    List<OverhaulOrderMajorFormBean> formVOsToBeans(List<OverhaulOrderMajorFormVO> vos);

    OverhaulOrderReadyBean readyVOToBean(OverhaulOrderReadyVO vo);

    List<OverhaulOrderReadyBean> readyVOsToBeans(List<OverhaulOrderReadyVO> vos);

    OverhaulOrderItemVO itemVOToBean(OverhaulOrderItemVO vo);

    List<OverhaulOrderItemBean> itemVOsToBeans(List<OverhaulOrderItemVO> vos);

    OverhaulOrderItemParamsBean paramVOToBean(OverhaulOrderItemParamsVO vo);

    List<OverhaulOrderItemParamsBean> paramVOsToBeans(List<OverhaulOrderItemParamsVO> vos);

    OrderDispatchTeam teamVoToTeamBean(OrderDispatchTeamVO team);

    List<OrderDispatchTeam> teamVosToTeamBeans(List<OrderDispatchTeamVO> teams);

    OrderDispatchVO dispatchBeanToVo(OrderDispatch dispatch);

    OrderDispatchTeamVO dispatchTeamBeanToVo(OrderDispatchTeam team);

    List<OrderDispatchTeamVO> dispatchTeamBeansToVos(List<OrderDispatchTeam> teams);

    OrderExecute executeVoToBean(OrderExecuteVO vo);

    List<OrderExecute> executeVosToBeans(List<OrderExecuteVO> vos);

    @Mappings({
            @Mapping(source = "orderExecuteId", target = "id"),
            @Mapping(source = "orderExecutePart", target = "parts")
    })
    OrderExecuteVO commonExecuteVoToExecuteVo(OrderExecuteVo vo);

    List<OrderExecuteVO> commonExecuteVosToExecuteVos(List<OrderExecuteVo> vos);
}
